package guiCode;
import gui.TeacherMainMenuGUI;
import gui.AddAssignmentGUI;
import gui.assignmentsGUI;

import java.sql.SQLException;

import javax.swing.JLabel;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.JTableHeader;

import secretary.defineSemester;
import teacher.*;

import basic.ClientConsole;

import com.sun.rowset.CachedRowSetImpl;

import flexibility.CachedRowSetTableModel;
import flexibility.userData;

import com.sun.rowset.CachedRowSetImpl;


public class AddAssignmentcode {
	private AddAssignmentGUI aag;
	public defineSemester semester=new defineSemester();
	int currentSem;
	public userData T_Data = new userData();
	public TeacherMainMenuGUI tmm ;
	public ClientConsole teacherConnection=TeacherMainMenuCode.getTeacherConnection();
	public CachedRowSetImpl rs;
	int myID=TeacherMainMenuCode.getMyID();
	private CachedRowSetTableModel data;
	
	public void addassignment(String CID,String fileId) {
		getCoursesCurrSem gcc=new getCoursesCurrSem();
		currentSem=semester.identify(0, teacherConnection, rs);
		addass a = new addass();
		System.out.println("ok");
		rs=a.addassignment(teacherConnection, rs, T_Data, myID,CID,fileId,currentSem);
		try {
			if(rs.next()){
				System.out.println("if");	
			}
			else{
				System.out.println("else");
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		//System.out.println(rs.getString(1));
		
	}
		
	

}
